﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
    public partial class Training : Form
    {
        public Form1 MyParentForm;
        public string location
        {
            //get { return txtLocation.Text; }
            get { return cmbLoc.Text; }
        }
        public string context
        {
            //get { return txtContext.Text; }
            get { return cmbCon.Text; }
        }
        public string activity
        {
            //get { return txtActivity.Text; }
            get { return cmbAct.Text; }
        }
        public Training()
        {
            InitializeComponent();
        }

        private void label1_Click(object sender, EventArgs e)
        {
            Close();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Close();
        }

        private void Training_Load(object sender, EventArgs e)
        {
            //txtLocation.Text = MyParentForm.getLocation();
            //txtActivity.Text = MyParentForm.getActivity();
            //txtContext.Text = MyParentForm.getContext();
            
            BindingList<string> loc_bind = new BindingList<string>();
            BindingList<string> con_bind = new BindingList<string>();
            BindingList<string> act_bind = new BindingList<string>();
            List<string> str = MyParentForm.getLocationList();
            foreach (string s in str)
                loc_bind.Add(s);
            str = MyParentForm.getActivityList();
            foreach (string s in str)
                act_bind.Add(s);
            str = MyParentForm.getContextList();
            foreach (string s in str)
                con_bind.Add(s);
            cmbLoc.DataSource = loc_bind;
            cmbLoc.Text = MyParentForm.getLocation();
            cmbAct.DataSource = act_bind;
            cmbAct.Text = MyParentForm.getActivity();
            cmbCon.DataSource = con_bind;
            cmbCon.Text = MyParentForm.getContext();
        }
        public string boxcontents
        {
            get { return cmbLoc.Text; }
        }
    }
}
